import { createRouter, createWebHistory } from "vue-router";
import home from "../pages/home.vue"
import news from "../pages/news.vue"
import about from "../pages/about.vue"
// 创建路由器
const router = createRouter({
  history: createWebHistory(),
  routes: [
    {
      path: "/",
      redirect: "/home" // 可选的默认路由重定向
    },
    {
      name: "homeName",
      path: "/home",
      component: home
    },
    {
      name: "newsName",
      path: "/news",
      component: news
    },
    {
      name: "aboutName",
      path: "/about",
      component: about
    },
  ]
})
export default router